Syntax | Description | Example |
---|---|---|
BR([varRes]) | Breaks (exits) a loop. Optionally returns a value for the loop. This function should be used only in the body expression of a loop. |
FOR(i=0,i<100,i+=1, { IF(i > 50, BR()) }) FOR(i=0,i<100,i+=1, { IF(i > 50, BR(i)) }) |
CONT() | Forces a loop to continue the next iteration. This function should be used only in the body expression of a loop. | count=0;FOR(i=0,i<100,i+=1, { IF(i > 50, CONT());count+=1 });count Returns: 51 |
DOWHILE(bContinueLoop, [, bodyExpr]) | Performs a do-while loop. The do-while loop performs the following sequence of steps: 1. Evaluates the bodyExpr. 2. If bContLoop evaluates to FALSE -> exit the loop 3. Go to step 1. Returns EMPTY. To return a value for the loop use the BR function. |
fact = 1; i = 2; DOWHILE(i <= 5, {fact = fact * i; i+= 1 }); fact Returns: 120 (the factorial of 5) |
FOR(initExpr, bContinueLoop, onEachExpr[, bodyExpr]) |
Performs a for loop. The for loop performs the following sequence of steps: |
fact = 1; FOR(i = 2, i <= 5, i+= 1, fact = fact * i); fact Returns: 120 (the factorial of 5) |
IF(bCondition, varTrueRes[, varFalseRes]) | Returns varTrueRes if bCondition is TRUE. Otherwise, it returns varFalseRes. If varFalseRes is not specified and bCondition is FALSE returns EMPTY. | a=1; b=2; IF(a>b, "a greater than b", "a not greater than b") Returns: "a not greater than b" |
RET(var) | Exits the formula evaluation with the specified result. |
10;20;RET("NOV");40;50 Returns: "NOV" |
WHILE(bContinueLoop, [, bodyExpr]) | Performs a while loop. The while performs the following sequence of steps: 1. If bContLoop evaluates to FALSE -> exit the loop 2. Evaluates the bodyExpr. 3. Go to step 1. Returns EMPTY. To return a value for the loop use the BR function. |
fact = 1; i = 2; WHILE(i <= 5, {fact = fact * i; i+= 1 }); fact Returns: 120 (the factorial of 5) |